feat: Add ByteTrack tracker with IoU matching and Kalman motion#6950
Open
omkar-334 wants to merge 11 commits into
Open
feat: Add ByteTrack tracker with IoU matching and Kalman motion#6950omkar-334 wants to merge 11 commits into
omkar-334 wants to merge 11 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces the ByteTrack multi-object tracking algorithm into libraries/getitrack, adding the matching (IoU + Hungarian assignment) and motion (constant-velocity Kalman filter in xyah) primitives it depends on, along with configuration defaults and unit tests.
Changes:
- Added ByteTrack tracker implementation + config variant and algorithm registration (
bytetrack). - Added matching utilities (IoU matrix / score fusion / threshold-gated Hungarian assignment) and a Kalman motion model with
xyxy↔xyahconversions. - Added SciPy as a dependency (for
linear_sum_assignmentandscipy.linalg) and introduced test coverage for matching, Kalman, config defaults, and ByteTrack behavior.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| libraries/getitrack/uv.lock | Locks SciPy (marker-split by Python version) and updates resolution markers. |
| libraries/getitrack/pyproject.toml | Adds scipy>=1.13 runtime dependency. |
| libraries/getitrack/configs/default.yaml | Updates defaults for ByteTrack split threshold and motion velocity decay. |
| libraries/getitrack/src/getitrack/init.py | Ensures bundled algorithms are imported/registered on package import; keeps default logging disabled. |
| libraries/getitrack/src/getitrack/algorithms/init.py | Exposes bundled algorithms package and imports ByteTrack to register it. |
| libraries/getitrack/src/getitrack/algorithms/bytetrack.py | Implements ByteTrackTracker + ByteTrackConfig, including association, lifecycle handling, and duplicate suppression. |
| libraries/getitrack/src/getitrack/matching/init.py | Exports matching helpers (IoU + assignment). |
| libraries/getitrack/src/getitrack/matching/iou.py | Implements IoU computation, score fusion, and threshold-gated Hungarian assignment. |
| libraries/getitrack/src/getitrack/motion/init.py | Exports Kalman filter + bbox conversion helpers. |
| libraries/getitrack/src/getitrack/motion/kalman.py | Implements constant-velocity Kalman filter and xyxy↔xyah conversions. |
| libraries/getitrack/src/getitrack/config.py | Updates MotionConfig.velocity_decay default to 1.0 (no damping) and adjusts docstring. |
| libraries/getitrack/tests/unit/test_matching.py | Adds unit tests for IoU, score fusion, and gated assignment behavior. |
| libraries/getitrack/tests/unit/test_kalman.py | Adds unit tests for Kalman filter behavior and bbox conversions. |
| libraries/getitrack/tests/unit/test_config.py | Updates unit test expectation for motion default velocity decay. |
| libraries/getitrack/tests/unit/test_bytetrack.py | Adds ByteTrack behavior tests (registry dispatch, lifecycle, low-score recovery, duplicate suppression, det_indices). |
Comment on lines
+115
to
+118
| motion_cov = self._predict_noise_cov(mean[3]) | ||
| new_mean = self._motion_mat @ mean | ||
| new_covariance = self._motion_mat @ covariance @ self._motion_mat.T + motion_cov | ||
| return new_mean, new_covariance |
| """ | ||
| if means.shape[0] == 0: | ||
| return means, covariances | ||
| motion_covs = np.stack([self._predict_noise_cov(h) for h in means[:, 3]], axis=0) |
kprokofi
reviewed
Jul 2, 2026
leoll2-alias
reviewed
Jul 2, 2026
kprokofi
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pr adds the ByteTrack tracking algorithm and the matching and motion primitives it builds on.
Changes
matching/: IoU distance, score fusion, and threshold-gated Hungarian assignment (scipy.optimize.linear_sum_assignment).motion/: a constant-velocity Kalman filter inxyahstate, withxyxyconversions.algorithms/bytetrack.py:ByteTrackTracker(two-stage high/low-score association, lost-track recovery, class-aware duplicate suppression) andByteTrackConfig, registered underbytetrack.algorithmname, soTrackerConfig.from_yamlandBaseTracker.from_configresolve toByteTrackConfigand constructByteTrackTracker.scipyadded to dependencies;Behavior
high_score_threshold, new tracks require a score0.1above it.Checklist